package cn.itcast.serivce.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import cn.itcast.dao.ClassRepository;
import cn.itcast.domain.HeiMaClass;
import cn.itcast.serivce.ClassSerivce;
@Service
@Transactional
public class ClassServiceimpl implements ClassSerivce{
 //注入dao
	@Autowired
	private ClassRepository classRepository;
	
	
	//添加班级
	@Override
	public void save(HeiMaClass heiMaClass) {
		 classRepository.save(heiMaClass);
	}

   
	//查询所有班级
	@Override
	public List<HeiMaClass> findByStatus(String status) {
		// TODO Auto-generated method stub
		return classRepository.findByClassStatus(status);
	}

	   //根据班级id修改班级
	@Override
	public void update(Integer id, String name) {
		// TODO Auto-generated method stub
		classRepository.update(id,name);
	}

  
	//删除班级
	@Override
	public void updateStatus(String classStatus) {	    
		   classRepository.updateStatus(classStatus);
	}


 


	
               
}
